"""
给定一个非空整数数组，除了某个元素只出现一次以外，其余每个元素均出现两次。找出那个只出现了一次的元素。
"""
class Solution:
    def singleNumber(self, nums: [int]) -> int:
        check = []
        res = []
        for i in nums:
            if check.__contains__(i):
                res.remove(i)
                continue
            else:
               check.append(i)
               res.append(i)
        return res[0]

# print(Solution.singleNumber(self=Solution, nums=[4,1,2,1,2]))